#ifndef USER_PLUGIN_DUMMY
#define USER_PLUGIN_DUMMY
#include <iostream>
#include <string>
#include <map>
#include "../../libpland/lib/plugin.hpp"
#include <unistd.h>
#include <stdlib.h>

using namespace std;

using namespace pland;

class Dummy : public UserC_Plugin
{
public:
    Dummy();
    ~Dummy();
    void start();
    void stop();
    void load_queues(SharedDQueue front ,SharedDQueue back);
    void setId(int id);
private:
    int id_;
    SharedDQueue front_;
    SharedDQueue back_;
    bool running_;
};

#endif


Dummy::Dummy()
{
    running_ = false;

}

void Dummy::start()
{
    cout << "Started Dummy Pluggin ID: " << id_ << endl << flush;
    running_ = true;
    while(running_)
    {
        SharedData next = front_->pop();
		back_->push(next);
    }
}

void Dummy::setId(int id)
{
    id_ = id;
}

void Dummy::stop()
{
    running_ = false;

}

void Dummy::load_queues(SharedDQueue front ,SharedDQueue back)
{
    front_  = front;
    back_  = back;
}


extern "C"
{

UserC_Plugin* Core_GetInstance()
{
    return new Dummy();
}

void Core_KillInstance(UserC_Plugin* a)
{
    delete a;
}

}
